const fs = require('fs');
const matter = require('gray-matter');

// 测试所有中文文档
const chineseFiles = [
  'ai-guide-chinese.md',
  'microservices-chinese.md', 
  'python-book-chinese.md'
];

console.log('测试中文 Front-matter 解析');
console.log('==========================\n');

chineseFiles.forEach(file => {
  try {
    const content = fs.readFileSync(`./example-docs/${file}`, 'utf-8');
    const parsed = matter(content);
    
    console.log(`📄 ${file}:`);
    console.log(JSON.stringify(parsed.data, null, 2));
    console.log('---\n');
  } catch (error) {
    console.error(`❌ 解析 ${file} 失败:`, error.message);
  }
});
